package org.xtb.CS_3;

import java.io.*;
import java.net.*;

public class DatabaseServer {


    public static void main(String[] args) {
        try (ServerSocket serverSocket = new ServerSocket(8890)) {
            System.out.println("数据库服务器已启动，等待应用服务器连接...");

            while (true) {
                Socket appSocket = serverSocket.accept();
                System.out.println("应用服务器已连接");

                DatabaseHandler databaseHandler = new DatabaseHandler(appSocket);
                databaseHandler.start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
